package com.jiyiren.bms;

import android.app.Activity;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.jiyiren.bms.aty.AtyBattery;
import com.jiyiren.bms.aty.BaseActivity;

public class MainActivity extends BaseActivity{


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setImmerseLayout(findViewById(R.id.mainact_out));
        delayThread();
    }


    private Handler mhandler=new Handler(){
        @Override
        public void handleMessage(Message msg) {
            enterMain();
        }
    };

    private void delayThread(){
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(3000);
                    mhandler.sendEmptyMessage(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    public void enterMain(){
        AtyBattery.enterBatteryAty(MainActivity.this);
        MainActivity.this.overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
        this.finish();
    }

}
